package com.haimi.shiguang.api;

import com.haimi.shiguang.base.biz.BaseResponse;
import com.haimi.shiguang.bean.request.LoginRequset;
import com.haimi.shiguang.bean.request.RegisterRequset;
import com.haimi.shiguang.bean.response.CenterResponse;
import com.haimi.shiguang.bean.response.LoginResponse;
import com.haimi.shiguang.net.UrlConstance;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @author changsunhaipeng
 * @date 2018/6/3
 */

public interface ApiInterface {
    /**
     * 测试接口
     *
     * @return
     */
    @Headers({"Accept: application/json"})
    @GET(UrlConstance.TEST)
    Observable<BaseResponse> test(
    );

    /**
     * 注册
     *
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST(UrlConstance.REGISTER)
    Observable<BaseResponse> register(@Body RegisterRequset registerRequset);

    /**
     * 登陆
     *
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST(UrlConstance.LOGIN)
    Observable<BaseResponse<LoginResponse>> login(@Body LoginRequset loginRequset);

    /**
     * center_checked
     *
     * @return
     */
    @Headers({"Accept: application/json"})
    @GET(UrlConstance.CENTER)
    Observable<BaseResponse<CenterResponse>> center(
            @Query("uid") String uid);

}
